cmake_minimum_required(VERSION 3.13)
find_package(LibDataChannel REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(CURL REQUIRED libcurl)

# 查找Boost库（WebSocket++需要）
find_package(Boost REQUIRED COMPONENTS system thread)

# 查找线程库
find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)  # 添加此行

# 查找PCL库
find_package(PCL REQUIRED COMPONENTS common io)

# 手动指定 WebSocket++ 头文件路径（根据实际路径调整）
include_directories(/usr/include/websocketpp)  # 如果通过 apt 安装
include_directories(/usr/include/nlohmann) 

add_executable(webrtc_test webrtc_test.cpp)

target_link_libraries(webrtc_test PRIVATE 
    LibDataChannel::LibDataChannel 
    OpenSSL::SSL
    ${CURL_LIBRARIES}
    ${Boost_LIBRARIES}
    ${PCL_LIBRARIES}
    Threads::Threads
)

target_include_directories(webrtc_test PRIVATE 
    ${CURL_INCLUDE_DIRS}
    ${Boost_INCLUDE_DIRS}
    ${PCL_INCLUDE_DIRS}
)

target_compile_options(webrtc_test PRIVATE 
    ${CURL_CFLAGS_OTHER}
)

# 设置C++标准
set_property(TARGET webrtc_test PROPERTY CXX_STANDARD 17)
set_property(TARGET webrtc_test PROPERTY CXX_STANDARD_REQUIRED ON)